package com.czbank.financing.mapper;

import com.czbank.financing.Entity.Mapping;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface MappingMapper {

    @Select("SELECT * FROM mapping")
    public List<Mapping> TotalMapping();

    @Select("SELECT * FROM mapping where id=#{id}")
    public Mapping selectMappingById(@Param("id") long id);

    @Update("updata mapping set uid=#{uid},rid=#{rid},pid=#{pid},change_type=#{change_type},change_note=#{change_note},cid=#{cid},change_time=#{change_time},creationtime=#{creationtime}")
    int updateMapping(@Param("mapping")Mapping mapping);

    @Insert("insert into mapping(uid,rid,,pid,change_type,change_note,cid,change_time,creationtime) values(#{uid},#{rid},#{pid},#{change_type},#{change_note},cid=#{cid},#{change_time},#{creationtime})")
    int addMapping(@Param("mapping")Mapping mapping);

    @Delete("delete * FROM mapping where id=#{id}")
    int deleteMapping(@Param("id")long id);
}
